package itdep.domain.student;

import itdep.domain.IisEntity;
import itdep.domain.profile.Profile;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import javax.persistence.*;


@Entity
@Table(name = "STUDENT_PARENT")
public class StudentParent extends IisEntity {

	@ManyToOne
	@JoinColumn(name = "ID_PROFILE", nullable = false)
	private Profile profile;

	@ManyToOne
	@JoinColumn(name = "ID_STUDENT", nullable = false)
	private Student student;

	@Type(type = "ga.hibernate.OrderedEnumUserType", parameters = {@Parameter(name = "enumClass", value = "itdep.domain.student.RelationType")})
	@Column(name = "RELATION_TYPE", nullable = false)
	private RelationType relationType;

	@Column(name = "WORK", nullable = true)
	private String work;

	public String getWork() {
		return work;
	}

	public void setWork(String work) {
		this.work = work;
	}

	public RelationType getRelationType() {
		return relationType;
	}

	public void setRelationType(RelationType relationType) {
		this.relationType = relationType;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}
}